package com.colorful.insuranceproject.base;

import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.colorful.insuranceproject.R;


/**
 * Created by lovely3x on 16/7/28.
 * <p>
 * 重写列表标题栏
 */
public abstract class PLEActivity extends com.lovely3x.common.activities.PLEActivity {
    @Override
    protected void addTitleHeader(ViewGroup titleContainer) {
        super.addTitleHeader(titleContainer);
        getTitleContainer().setBackgroundColor(getColor(R.color.colorPrimary, true));
        getTvTitle().setTextColor(getColor(R.color.white, true));
        getIvBack().setImageResource(R.drawable.icon_back_white);
        Drawable draw = ContextCompat.getDrawable(mActivity,R.drawable.icon_back_white);
        draw.setBounds(0, 0, draw.getMinimumWidth(), draw.getMinimumHeight());
        getTvback().setCompoundDrawables(draw,null,null,null);
        getTvback().setTextColor(getColor(R.color.white, true));
    }

    @Override
    public void handleEmptyContent(View.OnClickListener listener) {
//        super.handleEmptyContent(listener);
        emptyContainerCheck();
        if (transitionView != null) {
            emptyContainer.removeView(transitionView);
        }
        transitionView = getLayoutInflater().inflate(R.layout.view_empty_tip_gray, emptyContainer, false);
      //  transitionView.findViewById(com.lovely3x.common.R.id.ll_view_empty_click_area).setOnClickListener(listener);
        emptyContainer.addView(transitionView);
    }

    public TextView addRightBtn(String text, int id) {
        TextView tv = super.addRightBtn(text, id);
        tv.setTextColor(Color.WHITE);
        return tv;
    }
}
